<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
 function getUserIP(){

    if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])){
        if (isset($_SERVER['HTTP_CLIENT_IP'])){
            $proxy = $_SERVER['HTTP_CLIENT_IP'];
        }
        else{
            $proxy = $_SERVER['REMOTE_ADDR'];
        }
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    else{
        if (isset($_SERVER['HTTP_CLIENT_IP'])){
            $ip = $_SERVER['HTTP_CLIENT_IP'];
        }
        else{
            $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
        }
    }
    return isset($proxy) ? $proxy : $ip;

}
error_reporting(0);
session_start();
// 应用入口文件
header("Content-type: text/html; charset=utf-8");
/*if(getUserIp()!='114.244.152.248'){
        exit('对不起网站升级中');
}*/
// 检测PHP环境
if(version_compare(PHP_VERSION,'5.3.0','<'))  die('require PHP > 5.3.0 !');

// 开启调试模式 建议开发阶段开启 部署阶段注释或者设为false
define('APP_DEBUG',true);
//微信模拟session存放路径
//define('SESSION_DIR','/tmp/session/');
define('SESSION_DIR','./public/upload/session/');
// 定义应用目录
define('APP_PATH','./Application/');
define('MAIN_APP_PATH',dirname(__FILE__));
define('IS_ADMIN',1);
define('_DOMAIN_ALL_','novice.com');
define('IMAGE_DOMAIN','img.novice.com');
define('IMAGE_DOMAIN_','192.168.0.120:8081');
define('_UPGRADE_TIME_',1479654000);
// 引入ThinkPHP入口文件
require './ThinkPHP/ThinkPHP.php';

// 亲^_^ 后面不需要任何代码了 就是如此简单
